package com.yaodian100.ec.image.service;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.image.entity.Image;

public interface Image2Service extends DomainService<Image> {
	public void deletePic(Long[] picId);

	// public String editImgDetail(Long imgId, File[] imageDes) throws CoreException;

	// public String editImgDetail(Long imgId, File[] imageDes, String picShowSeq) throws CoreException;

	public void batchProcessImage(Long[] delImgIds, Long[] imgIds, Map<Long, File> replaceImgFiles);

	/**
	 * 圖檔上傳(雙屬性)(新增/修改用),不用sync
	 * 
	 * @param productId 商品编号
	 * @param type [MAIN方形主图,RMAIN长形主图,SPEC方形细节图,RSPEC长形细节图,IMGB大描述图,IMGS小描述图,DESC说明图,ICON示意图]
	 * @param specId 规格编号
	 * @param images 图檔
	 * @param imageFileName 图檔名称
	 * @return
	 * @throws CoreException
	 */
	public boolean uploadImage(String productId, List<String> type, List<String> specId, List<File> images,
			List<String> imageFileName) throws CoreException;

	/**
	 * 圖檔上傳(雙屬性)(新增/修改用),不用sync
	 * 
	 * @param productId 商品编号
	 * @param type [MAIN方形主图,RMAIN长形主图,SPEC方形细节图,RSPEC长形细节图,IMGB大描述图,IMGS小描述图,DESC说明图,ICON示意图]
	 * @param specId 规格编号
	 * @param images 图檔
	 * @param imageFileName 图檔名称
	 * @param coverId 封面id
	 * @return
	 * @throws CoreException
	 */
	public boolean uploadImage(String productId, List<String> type, List<String> specId, List<File> images,
			List<String> imageFileName, String coverId, Long[] delSpecImgIds, Map<Long, File> replaceImgFiles,
			Map<String, Integer> imgShowSeqData) throws CoreException;

	public boolean uploadImage(String productId, List<String> type, List<String> specId, List<File> images,
			List<String> imageFileName, String coverId) throws CoreException;

	/**
	 * 设为封面图
	 * 
	 * @param productId 商品编号
	 * @param mainSpecId 规格编号
	 * @return
	 * @throws CoreException
	 */
	public boolean changeCover(String productId, Long mainSpecId) throws CoreException;

	public void updMajor(String productId);

	/**
	 * 檢查檔案尺寸、大小
	 * 
	 * @param type
	 * @param files
	 * @return
	 * @throws IOException
	 */
	public String chkFileSize(String type, List<File> files, List<String> fileNamesList) throws IOException;

}
